package com.util;


import com.arcsoft.FaceInfo;

import java.awt.*;
import java.awt.image.BufferedImage;


/**
 * frame 绘制帮助
 */
public class FrameUtils {

    public static BufferedImage printFaceInFrame(BufferedImage image, FaceInfo[] faceInfoS) {
        Graphics2D graphics2D = image.createGraphics();
        for (FaceInfo faceInfo : faceInfoS) {
            graphics2D.drawRect(faceInfo.left, faceInfo.top,
                    faceInfo.right - faceInfo.left,
                    faceInfo.bottom - faceInfo.top);
        }
        graphics2D.dispose();
        return image;
    }

    public static BufferedImage drawPicture(BufferedImage image, BufferedImage small) {
        Graphics2D graphics2D = image.createGraphics();
        graphics2D.drawImage(small, 0, 0,  (img, infoflags, x, y, width, height) -> false);
        graphics2D.dispose();
        return image;
    }
}
